from django.db import models
from django.utils import timezone


class Information(models.Model):
    user_id = models.BigIntegerField(unique=True)
    platform_id = models.CharField(max_length=32)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    device_type = models.IntegerField()
    registered_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)
    extra_info = models.CharField(max_length=128, null=True)
    qk_appid = models.CharField(max_length=128, null=True)
    agent_chn = models.CharField(max_length=128, null=True)


class DWCDark4Information(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    device_type = models.IntegerField()
    registered_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)
    extra_info = models.CharField(max_length=128, null=True)
    qk_appid = models.CharField(max_length=128, null=True)
    agent_chn = models.CharField(max_length=128, null=True)


class DWCDark3Information(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    device_type = models.IntegerField()
    registered_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)
    extra_info = models.CharField(max_length=128, null=True)
    qk_appid = models.CharField(max_length=128, null=True)
    agent_chn = models.CharField(max_length=128, null=True)


class DWCDark2Information(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    device_type = models.IntegerField()
    registered_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)
    extra_info = models.CharField(max_length=128, null=True)
    qk_appid = models.CharField(max_length=128, null=True)
    agent_chn = models.CharField(max_length=128, null=True)


class DWCTaiTanInformation(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    device_type = models.IntegerField()
    registered_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)
    extra_info = models.CharField(max_length=128, null=True)
    qk_appid = models.CharField(max_length=128, null=True)
    agent_chn = models.CharField(max_length=128, null=True)


class LokiInformation(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    registered_at = models.DateTimeField()
    active_at = models.DateTimeField()


class LokiDeviceInformation(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    created_at = models.DateTimeField()
    active_at = models.DateTimeField()


class WitchInformation(models.Model):
    user_id = models.BigIntegerField(unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    aid = models.CharField(max_length=128)
    registered_at = models.DateTimeField()
    active_at = models.DateTimeField()


class WitchDeviceInformation(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    created_at = models.DateTimeField()
    active_at = models.DateTimeField()


class Device(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    device_type = models.IntegerField(default=0)
    created_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)


class DWCDark4Device(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    device_type = models.IntegerField(default=0)
    created_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)


class DWCDark3Device(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    device_type = models.IntegerField(default=0)
    created_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)


class DWCDark2Device(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    device_type = models.IntegerField(default=0)
    created_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)


class DWCTaiTanDevice(models.Model):
    aid = models.CharField(max_length=128, unique=True)
    channel = models.CharField(max_length=128)
    ip = models.CharField(max_length=32)
    device_type = models.IntegerField(default=0)
    created_at = models.DateTimeField(default=timezone.now)
    active_at = models.DateTimeField(default=timezone.now)


class AppDownload(models.Model):
    platform_id = models.CharField(max_length=32)
    ip = models.CharField(max_length=32)
    chn = models.CharField(max_length=128)
    appid = models.CharField(max_length=128)
    downloaded_at = models.DateTimeField(default=timezone.now)
    last_downloaded_at = models.DateTimeField(default=timezone.now)
